package com.qk.management.mapper;


import com.qk.domain.user.UserDO;
import com.qk.dto.user.UserDTO;
import com.qk.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {
    List<UserDO> getUsers(UserDTO userDto);

    void insert(User user);

    void deleteByIds(List<Integer> ids);

    @Select("SELECT * FROM user WHERE id = #{id}")
    User selectById(Integer id);


    void updateById(User user);

    @Select("SELECT * FROM user WHERE username = #{username}")
    User getUserByUsername(String username);

    @Select("SELECT * FROM user")
    List<User> list();

    @Select("SELECT * FROM user WHERE role_id = #{id}")
    List<User> listByRole(Integer id);
}
